package com.wenda.admin.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Resp {
    private int code;
    private String msg;
    private Object data;

    public static Resp error(IBizCode code) {
        return new Resp(code.getCode(), code.getName(), null);
    }

    public static Resp error(String msg,Object data) {
        return new Resp(-1, msg, data);
    }

    public static Resp success(Object data) {
        return new Resp(0, null, data);
    }


    public static Resp success(String msg,Object data) {
        return new Resp(0, msg, data);
    }
}
